home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: gets(rec->num); I don't know what I am doing wrong...
- Date: Wed, 21 Feb 96 14:39:37 GMT
- Organization: none
- Message-ID: <824913577snz@genesis.demon.co.uk>
- References: <4fempt$mjg@aphex.direct.ca> <3129dbf1.656738@news.iquest.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <3129dbf1.656738@news.iquest.net>
- rclark@iquest.net "Robert B. Clark" writes:
-
- >...but this not. gets() is defined as
- >
- > char * gets(char *s)
- >
- >gets() expects a pointer to char and returns a pointer to char or EOF or
- >NULL.
-
- EOF is a 'negative integral constant expression' which means that gets()
- certainly can't return it. gets() returns NULL on either end-of-file or
- an error condition - you can subsequently use feof() or ferror() to
- determine which. While this is academic for gets() (since of course you
- never use it) it also applies to other functions such as fgets().
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-